; *** Nim
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
("Player-1" "玩家一")("Player-2" "玩家二")
("Nim - Setup 1" "取子游戏 1")
("Nim - Setup 2" "取子游戏 2")
("Nim - Setup 3" "取子游戏 3")
("Nim - Setup 4" "取子游戏 4")
("Nim - Setup 5" "取子游戏 5")
)
(version "2.0")

(game
    (title "Nim - Setup 1")
	(description "先将最后一艘船取走为胜。\你可以取任意位置的船，若它的上方有船，则一并被取走。")
	(history "Nim-like games are quite ancient, and played in many cultures.  The
         name Nim (probably from an old English word meaning `take`) was originated by
         Charles Leonard Bouton, a mathematics professor at Harvard University, who
         analyzed the most common form of the game in 1901.  Many more complex variants
         of the game have since been devised, and mathematicians have devoted
         considerable effort to analyzing various games.")
      (strategy "The basis of Nim strategy is identifying safe and unsafe positions.
         You can experiment with the game yourself, and learn some of the safe positions
         (positions one aims to leave for the opponent) yourself.   An example is any
         position with two rows left and the same number of ships left in each.   See
         the Zillions website at <http://www.zillions-of-games.com/nim.html> for an
         explanation of how to use binary arithmetic to determine whether any
         position is safe or unsafe, and a list of further references on the game.")
	(opening-sound "Audio\\Ocean.wav")
	(win-sound "Audio\\Thunder.wav")
	(loss-sound "Audio\\Thunder.wav")
	(move-sound "Audio\\Whale.wav")
	(capture-sound "")
    (players Player-1 Player-2 Other)
    (turn-order (Player-1 Other) (Player-2 Other))
    (option "smart moves" true)
    (board
        (image "images\Nim\Nim.bmp" "images\Nim\Nim2.bmp")
        (grid
            (start-rectangle 2 -43 48 0) ; (start-rectangle 5 -45 55 5)
            (dimensions
                ("a/b/c/d/e" (47 0)) ; files
                ("6/5/4/3/2/1" (0 44)) ; ranks
            )
            (directions (n 0 -1) (s 0 1))
		)
		(positions (off-board 240 -320 330 -240))
	)
    (piece
        (image Other "images\Nim\ship.bmp")
        (name Ship)
		(help "点击这里取走它以及它上面所有的船。")
		(moves
		   ( (while (not-empty? n) capture n) capture off-board add)
		)					
	)
   
  
	(board-setup
        (Other (Ship a1 c1 c2 c3 e1 e2 e3 e4 e5)
		)
	)
    (loss-condition (Player-1 Player-2) stalemated)
)

(variant
  (title "Nim - Setup 2")
  (board-setup (Other (Ship a1 a2 c1 c2 c3 c4 e1 e2 e3 e4 e5)))
)
(variant
  (title "Nim - Setup 3")
  (board-setup (Other (Ship a1 b1 b2 c1 c2 c3 d1 d2 d3 d4 e1 e2 e3 e4 e5)))
)
(variant
  (title "Nim - Setup 4")
  (board-setup (Other (Ship a1 a2 a3 a4 a5 b1 b2 b3 b4 c1 c2 c3 d1 d2 d3 d4 e1 e2 e3 e4 e5)))
)
(variant
  (title "Nim - Setup 5")
  (board-setup (Other (Ship a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 c3 c4 c5 
    d1 d2 d3 d4 d5 e1 e2 e3 e4 e5)))
)

